package day1024_3;

import java.util.Scanner;

public class E2 {
    public static void main(String[] args) {
        E2 c=new E2();
        try {
            int h=c.getAge();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
    public  int  getAge(){
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入您的年龄：");
        int age=sc.nextInt();
        if(age<=0  ||  age>180){
            throw  new  RuntimeException("您输入的年龄超范围了");
        }
        return  age;
    }
}//  192.168.231.1





